import requests
from lxml import etree
from 微博相关爬取 import WeiboSpider

wei = WeiboSpider('JiangPin')
url = 'https://s.weibo.com/weibo?q=姜萍&typeall=1&suball=1&timescope=custom%3A2024-06-13-12%3A2024-06-13-13&Refer=g'
response = wei.get_response(url=url,type='Html')
platform_list_temp = response.xpath("//div[@class='from']")
print(platform_list_temp)
platform_list = []
for i in platform_list_temp:
    s=i.xpath("./a/text()")
    try:
        platform_list.append(s[1])
    except IndexError:
        platform_list.append('')
print(platform_list)